home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / glibmm-2.4 / glibmm / sarray.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  2.6 KB  |  109 lines

  1. // -*- c++ -*-
  2. #ifndef _GLIBMM_SARRAY_H
  3. #define _GLIBMM_SARRAY_H
  4.  
  5. /* $Id: sarray.h,v 1.1.1.1 2003/01/07 16:58:53 murrayc Exp $ */
  6.  
  7. /* array.h
  8.  *
  9.  * Copyright (C) 2002 The gtkmm Development Team
  10.  *
  11.  * This library is free software; you can redistribute it and/or
  12.  * modify it under the terms of the GNU Library General Public
  13.  * License as published by the Free Software Foundation; either
  14.  * version 2 of the License, or (at your option) any later version.
  15.  *
  16.  * This library is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  19.  * Library General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU Library General Public
  22.  * License along with this library; if not, write to the Free
  23.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  */
  25.  
  26.  
  27. #include <glibmm/arrayhandle.h>
  28. #include <glibmm/ustring.h>
  29.  
  30. namespace Glib { typedef Glib::ArrayHandle<Glib::ustring> SArray; }
  31.  
  32. #if 0
  33.  
  34. namespace Glib
  35. {
  36.  
  37. template <>
  38. inline void cpp_type_to_c_type(const ustring& cpp_value, type_constpch& ref_c_value)
  39. {
  40.   ref_c_value = cpp_value.c_str();
  41. }
  42.  
  43. template <>
  44. inline void cpp_type_to_c_type(const std::string& cpp_value, type_constpch& ref_c_value)
  45. {
  46.   ref_c_value = cpp_value.c_str();
  47. }
  48.  
  49. typedef Array<Glib::ustring, const char*> SArray;
  50.  
  51. /*
  52. class SArray: public Array<nstring, const char*>
  53. {
  54. public:
  55.   typedef const char* T_c;
  56.   typedef Array<nstring, const char*> type_base;
  57.  
  58.   SArray(const SArray& src);
  59.  
  60.   // copy other containers
  61.   template <typename T_container>
  62.   SArray(const T_container& t)
  63.   {
  64.     owned_ = Array_Helpers::Traits<T_container, pointer>::get_owned();
  65.     size_ = Array_Helpers::Traits<T_container, pointer>::get_size(t);
  66.     pData_ = Array_Helpers::Traits<T_container, pointer>::get_data(t);
  67.   }
  68.  
  69.   SArray(const T_c* pValues, size_type size);
  70.  
  71.   // copy a sequence
  72.   template <typename Iterator>
  73.   SArray(Iterator b, Iterator e);
  74.  
  75.   operator std::vector<nstring>() const;
  76.   operator std::vector<ustring>() const;
  77.   operator std::vector<std::string>() const;
  78.  
  79.   operator std::deque<nstring>() const;
  80.   operator std::deque<ustring>() const;
  81.   operator std::deque<std::string>() const;
  82.  
  83.   operator std::list<nstring>() const;
  84.   operator std::list<ustring>() const;
  85.   operator std::list<std::string>() const;
  86. };
  87.  
  88.  
  89. //template <typename T_container>
  90. //SArray::SArray(const T_container& t)
  91. //: type_base(t)
  92. //{
  93. //}
  94.  
  95.  
  96. template <typename Iterator>
  97. SArray::SArray(Iterator b, Iterator e)
  98. : type_base(b, e)
  99. {
  100. }
  101. */
  102.  
  103. } // namespace Glib
  104.  
  105. #endif /* #if 0 */
  106.  
  107. #endif // _GLIBMM_SARRAY_H
  108.  
  109.